﻿<CodeSnippets
    xmlns="http://schemas.microsoft.com/VisualStudio/2008/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>spchol305_ex1_spchol305feature_receiver</Title>
      <Shortcut>spchol305_ex1_spchol305feature_receiver</Shortcut>
      <Description>Code snippet for spchol305 Ex1 spchol305Feature Event Receiver</Description>
      <Author>Microsoft Corporation</Author>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="csharp">
        <![CDATA[public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
    SPWebApplication wappCurrent = (SPWebApplication)properties.Feature.Parent;
    SPWebConfigModification modAuthorizedType = new SPWebConfigModification();
    modAuthorizedType.Name = "AuthType";
    modAuthorizedType.Owner = "SPDActivityDemo";
    modAuthorizedType.Path =
    "configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes";
    modAuthorizedType.Type =
    SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
    modAuthorizedType.Value = "<authorizedType Assembly=\"SPDActivityDemo, " 
    + "Version=1.0.0.0, Culture=neutral, PublicKeyToken=a66e91d2ee2fa8f8\" " 
    + "Namespace=\"SPDActivityDemo\" TypeName=\"*\" Authorized=\"True\" />";
    wappCurrent.WebConfigModifications.Add(modAuthorizedType);
    wappCurrent.WebService.ApplyWebConfigModifications();
}]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
